#include "lobby.h"

Lobby::Lobby(int id, LobbyType type, QString name, QString password, QObject *parent) :  QThread(parent)
{
    _id = id;
    _type = type;
    _name = name;
    _password = password;
}

void Lobby::run()
{
    if(_type == CHAT) return;
}

bool Lobby::userAdd(User *user){
    _userList.append(user);
}

bool Lobby::userRemove(User *user){
    _userList.removeOne(user);
}

bool Lobby::containUser(User *user){
    foreach(User *u,_userList){
        if(u==user) return true;
    }
    return false;
}

bool Lobby::checkAuth(QString name, QString pass){
    if(_name == name && _password == pass) return true;
    else return false;
}
